package Project;
//___________________________IMPORTACIONES______________________________________

import Validaciones.*;
import java.awt.*;
import java.sql.*;
import javax.swing.*;
import javax.swing.table.*;
//______________________________________________________________________________

public class Opciones extends javax.swing.JPanel {
//_____________________________ATRIBUTOS________________________________________

    String sql;
    int Dialog;

//_____________________________CONSTRUCTOR______________________________________
    public Opciones() {
        initComponents();
        ocultar();
        dlgCargandoDatos.setDefaultCloseOperation(0);
    }
//________________________________METODOS_______________________________________

    private void ocultar() {

        String a = Container.lblPrivilegio.getText();

        if (a.equals("3")) {
            for (int i = 0; i < jPanel1.getComponents().length; i++) {
                jPanel1.getComponent(i).setEnabled(false);
            }
            for (int i = 0; i < jPanel2.getComponents().length; i++) {
                jPanel2.getComponent(i).setEnabled(false);
            }
            for (int i = 0; i < jPanel3.getComponents().length; i++) {
                jPanel3.getComponent(i).setEnabled(false);
            }
            for (int i = 0; i < jPanel10.getComponents().length; i++) {
                jPanel10.getComponent(i).setEnabled(false);
            }

            btnVerTablaRutas.setEnabled(true);
            btnModificarRuta.setEnabled(false);
            btnEliminarRuta.setEnabled(false);
            btnVerTablaMarcas.setEnabled(true);
            btnModificarMarcas.setEnabled(false);
            btnEliminarMarcas.setEnabled(false);
            btnVerTablaTipos.setEnabled(true);
            btnModificarTipos.setEnabled(false);
            btnEliminarTipo.setEnabled(false);
            btnVerTablaPropietarios.setEnabled(true);
            btnModificarPropietarios.setEnabled(false);
            btnEliminarPropietarios.setEnabled(false);
        }
    }

    private void tamanoRutas() {

        int ancho = 489;
        int anchoColumna = 0;
        TableColumnModel modeloColumna = tablaRutas.getColumnModel();
        TableColumn columnaTabla;
        for (int i = 0; i < tablaRutas.getColumnCount(); i++) {
            columnaTabla = modeloColumna.getColumn(i);
            switch (i) {
                case 0:
                    anchoColumna = (0 * ancho) / 100;
                    break;
                case 1:
                    anchoColumna = (100 * ancho) / 100;
                    break;
            }
            columnaTabla.setPreferredWidth(anchoColumna);
        }
    }
//______________________________________________________________________________

    private void tamanoMarcas() {

        int ancho = 472;
        int anchoColumna = 0;
        TableColumnModel modeloColumna = tablaMarcas.getColumnModel();
        TableColumn columnaTabla;
        for (int i = 0; i < tablaMarcas.getColumnCount(); i++) {
            columnaTabla = modeloColumna.getColumn(i);
            switch (i) {
                case 0:
                    anchoColumna = (0 * ancho) / 100;
                    break;
                case 1:
                    anchoColumna = (100 * ancho) / 100;
                    break;
            }
            columnaTabla.setPreferredWidth(anchoColumna);
        }
    }
//______________________________________________________________________________

    private void tamanoTipos() {

        int ancho = 489;
        int anchoColumna = 0;
        TableColumnModel modeloColumna = tablaTipos.getColumnModel();
        TableColumn columnaTabla;
        for (int i = 0; i < tablaTipos.getColumnCount(); i++) {
            columnaTabla = modeloColumna.getColumn(i);
            switch (i) {
                case 0:
                    anchoColumna = (0 * ancho) / 100;
                    break;
                case 1:
                    anchoColumna = (100 * ancho) / 100;
                    break;
            }
            columnaTabla.setPreferredWidth(anchoColumna);
        }
    }
//______________________________________________________________________________

    private void tamanoPropietarios() {

        int ancho = 1000;
        int anchoColumna = 0;
        TableColumnModel modeloColumna = tablaPropietarios.getColumnModel();
        TableColumn columnaTabla;
        for (int i = 0; i < tablaPropietarios.getColumnCount(); i++) {
            columnaTabla = modeloColumna.getColumn(i);
            switch (i) {
                case 0:
                    anchoColumna = (25 * ancho) / 100;
                    break;
                case 1:
                    anchoColumna = (0 * ancho) / 100;
                    break;
                case 2:
                    anchoColumna = (0 * ancho) / 100;
                    break;
                case 3:
                    anchoColumna = (20 * ancho) / 100;
                    break;
                case 4:
                    anchoColumna = (20 * ancho) / 100;
                    break;
                case 5:
                    anchoColumna = (20 * ancho) / 100;
                    break;
            }
            columnaTabla.setPreferredWidth(anchoColumna);
        }
    }
//______________________________________________________________________________

    private void llenarRutas() {

        BaseDeDatos.conectarse();

        try {

            sql = "select * from ruta order by id";

            DefaultTableModel modelo = new DefaultTableModel();
            tablaRutas.setModel(modelo);
            modelo.addColumn("ID");
            modelo.addColumn("RUTA");

            Statement s = BaseDeDatos.con.createStatement();
            ResultSet rs = s.executeQuery(sql);

            while (rs.next()) {
                // Se crea un array que será una de las filas de la tabla. 
                Object[] fila = new Object[2]; // Hay 2 columnas en la tabla

                // Se rellena cada posición del array con una de las columnas de la tabla en base de datos.
                for (int i = 0; i < 2; i++) {
                    fila[i] = rs.getObject(i + 1); // El primer indice en rs es el 1, no el cero, por eso se suma 1.
                }
                // Se añade al modelo la fila completa.
                modelo.addRow(fila);
            }
            BaseDeDatos.desconectarse();
            tablaRutas.setModel(modelo);
            tamanoRutas();
            tablaRutas.getColumnModel().getColumn(0).setMaxWidth(0);
            tablaRutas.getColumnModel().getColumn(0).setMinWidth(0);
            tablaRutas.getColumnModel().getColumn(0).setPreferredWidth(0);
            tablaRutas.getColumnModel().getColumn(0).setResizable(false);

        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
        }
    }
//______________________________________________________________________________

    private void llenarMarcas() {

        BaseDeDatos.conectarse();

        try {

            sql = "select * from marca order by id";

            DefaultTableModel modelo = new DefaultTableModel();
            tablaMarcas.setModel(modelo);
            modelo.addColumn("ID");
            modelo.addColumn("MARCA");

            Statement s = BaseDeDatos.con.createStatement();
            ResultSet rs = s.executeQuery(sql);

            while (rs.next()) {
                // Se crea un array que será una de las filas de la tabla. 
                Object[] fila = new Object[2]; // Hay 2 columnas en la tabla

                // Se rellena cada posición del array con una de las columnas de la tabla en base de datos.
                for (int i = 0; i < 2; i++) {
                    fila[i] = rs.getObject(i + 1); // El primer indice en rs es el 1, no el cero, por eso se suma 1.
                }
                // Se añade al modelo la fila completa.
                modelo.addRow(fila);
            }
            BaseDeDatos.desconectarse();
            tablaMarcas.setModel(modelo);
            tamanoMarcas();
            tablaMarcas.getColumnModel().getColumn(0).setMaxWidth(0);
            tablaMarcas.getColumnModel().getColumn(0).setMinWidth(0);
            tablaMarcas.getColumnModel().getColumn(0).setPreferredWidth(0);
            tablaMarcas.getColumnModel().getColumn(0).setResizable(false);
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
        }
    }
//______________________________________________________________________________

    private void llenarTipos() {

        BaseDeDatos.conectarse();

        try {

            sql = "select * from tipo order by id";

            DefaultTableModel modelo = new DefaultTableModel();
            tablaTipos.setModel(modelo);
            modelo.addColumn("ID");
            modelo.addColumn("TIPO");

            Statement s = BaseDeDatos.con.createStatement();
            ResultSet rs = s.executeQuery(sql);

            while (rs.next()) {
                // Se crea un array que será una de las filas de la tabla. 
                Object[] fila = new Object[2]; // Hay 2 columnas en la tabla

                // Se rellena cada posición del array con una de las columnas de la tabla en base de datos.
                for (int i = 0; i < 2; i++) {
                    fila[i] = rs.getObject(i + 1); // El primer indice en rs es el 1, no el cero, por eso se suma 1.
                }
                // Se añade al modelo la fila completa.
                modelo.addRow(fila);
            }
            BaseDeDatos.desconectarse();
            tablaTipos.setModel(modelo);
            tamanoTipos();
            tablaTipos.getColumnModel().getColumn(0).setMaxWidth(0);
            tablaTipos.getColumnModel().getColumn(0).setMinWidth(0);
            tablaTipos.getColumnModel().getColumn(0).setPreferredWidth(0);
            tablaTipos.getColumnModel().getColumn(0).setResizable(false);
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
        }
    }
//______________________________________________________________________________

    private void llenarPropietarios(String Valor) {

        BaseDeDatos.conectarse();

        try {

            int valor_dos = cbxFiltro.getSelectedIndex();

            if (valor_dos == 0) {
                sql = "select * from propietario where nombre_completo ILIKE '" + Valor + "%' order by nombre_completo";
            } else if (valor_dos == 1) {
                sql = "SELECT * FROM propietario WHERE CAST(cedula AS CHAR(15)) LIKE '" + Valor + "%' order by nombre_completo";

            }

            DefaultTableModel modelo = new DefaultTableModel();
            tablaPropietarios.setModel(modelo);
            modelo.addColumn("NOMBRE");
            modelo.addColumn("NOMBRE");
            modelo.addColumn("APELLIDO");
            modelo.addColumn("CEDULA");
            modelo.addColumn("DIRECCION");
            modelo.addColumn("TELEFONO");

            Statement s = BaseDeDatos.con.createStatement();
            ResultSet rs = s.executeQuery(sql);

            while (rs.next()) {
                // Se crea un array que será una de las filas de la tabla. 
                Object[] fila = new Object[6]; // Hay 6 columnas en la tabla

                // Se rellena cada posición del array con una de las columnas de la tabla en base de datos.
                for (int i = 0; i < 6; i++) {
                    fila[i] = rs.getObject(i + 1); // El primer indice en rs es el 1, no el cero, por eso se suma 1.
                }
                // Se añade al modelo la fila completa.
                modelo.addRow(fila);
            }
            BaseDeDatos.desconectarse();
            tablaPropietarios.setModel(modelo);
            tamanoPropietarios();
            tablaPropietarios.getColumnModel().getColumn(1).setMaxWidth(0);
            tablaPropietarios.getColumnModel().getColumn(1).setMinWidth(0);
            tablaPropietarios.getColumnModel().getColumn(1).setPreferredWidth(0);
            tablaPropietarios.getColumnModel().getColumn(1).setResizable(false);
            tablaPropietarios.getColumnModel().getColumn(2).setMaxWidth(0);
            tablaPropietarios.getColumnModel().getColumn(2).setMinWidth(0);
            tablaPropietarios.getColumnModel().getColumn(2).setPreferredWidth(0);
            tablaPropietarios.getColumnModel().getColumn(2).setResizable(false);
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
        }
    }
//______________________________________________________________________________

    private void insertarRuta() {

        BaseDeDatos.conectarse();
        Dialog = JOptionPane.showConfirmDialog(null, "Esta seguro de ingresar este nuevo registro",
                "Advertencia", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
        if (Dialog == JOptionPane.YES_NO_OPTION) {
            try {
                String ruta = txtRuta.getText();
                sql = "insert into ruta (ruta) values ('" + ruta.toUpperCase() + "')";
                int resultado = BaseDeDatos.stmt.executeUpdate(sql);
                if (resultado == 1) {
                    JOptionPane.showMessageDialog(null, "El registro se agrego de manera exitosa", "Info", JOptionPane.INFORMATION_MESSAGE);
                    txtRuta.setText("");
                    txtRuta.requestFocus();
                }
            } catch (SQLException | HeadlessException e) {
                JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
            }
        }
        BaseDeDatos.desconectarse();
        llenarRutas();
    }
//______________________________________________________________________________

    private void insertarMarca() {

        BaseDeDatos.conectarse();
        Dialog = JOptionPane.showConfirmDialog(null, "Esta seguro de ingresar este nuevo registro",
                "Advertencia", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
        if (Dialog == JOptionPane.YES_NO_OPTION) {
            try {

                String marca = txtMarca.getText();
                sql = "insert into marca (marca) values ('" + marca.toUpperCase() + "')";
                int resultado = BaseDeDatos.stmt.executeUpdate(sql);
                if (resultado == 1) {
                    JOptionPane.showMessageDialog(null, "El registro se agrego de manera exitosa", "Info", JOptionPane.INFORMATION_MESSAGE);
                    txtMarca.setText("");
                    txtMarca.requestFocus();
                }
            } catch (SQLException | HeadlessException e) {
                JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
            }
        }
        BaseDeDatos.desconectarse();
        llenarMarcas();
    }
//______________________________________________________________________________

    private void insertarTipo() {

        BaseDeDatos.conectarse();
        Dialog = JOptionPane.showConfirmDialog(null, "Esta seguro de ingresar este nuevo registro",
                "Advertencia", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
        if (Dialog == JOptionPane.YES_NO_OPTION) {
            try {

                String tipo = txtTipo.getText();
                sql = "insert into tipo (tipo) values ('" + tipo.toUpperCase() + "')";
                int resultado = BaseDeDatos.stmt.executeUpdate(sql);
                if (resultado == 1) {
                    JOptionPane.showMessageDialog(null, "El registro se agrego de manera exitosa", "Info", JOptionPane.INFORMATION_MESSAGE);
                    txtTipo.setText("");
                    txtTipo.requestFocus();
                }
            } catch (SQLException | HeadlessException e) {
                JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
            }
        }
        BaseDeDatos.desconectarse();
        llenarTipos();
    }
//______________________________________________________________________________

    private void insertarPropietario() {

        BaseDeDatos.conectarse();
        Dialog = JOptionPane.showConfirmDialog(jPanel10, "Esta seguro de ingresar este nuevo registro",
                "Advertencia", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
        if (Dialog == JOptionPane.YES_NO_OPTION) {
            try {

                String nombre = txtNombre.getText();
                String apellido = txtApellido.getText();
                String cedula = txtCedula.getText();
                String direccion = txtDireccion.getText();
                String telefono = txtTelefono.getText();

                sql = "insert into propietario values ('" + nombre.toLowerCase() + " " + apellido.toLowerCase() + "','" + nombre.toLowerCase() + "', '" + apellido.toLowerCase() + "', " + cedula + ", '" + direccion.toLowerCase() + "', " + telefono + ")";
                int resultado = BaseDeDatos.stmt.executeUpdate(sql);
                if (resultado == 1) {
                    JOptionPane.showMessageDialog(jPanel10, "El registro se agrego de manera exitosa", "Info", JOptionPane.INFORMATION_MESSAGE);
                    txtNombre.setText("");
                    txtNombre.requestFocus();
                    txtApellido.setText("");
                    txtCedula.setText("");
                    txtDireccion.setText("");
                    txtTelefono.setText("");
                }
            } catch (SQLException | HeadlessException e) {
                JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
                System.out.println(sql);
            }
        }
        BaseDeDatos.desconectarse();
        llenarPropietarios("");
    }
//______________________________________________________________________________

    private void eliminarRuta() {

        BaseDeDatos.conectarse();
        if (tablaRutas.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else if (JOptionPane.showConfirmDialog(null, "Esta seguro de que desea eliminar este registro",
                "Advertencia", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_NO_OPTION) {
            try {

                lblIdRuta.setText("" + tablaRutas.getValueAt(tablaRutas.getSelectedRow(), 0));
                String d = lblIdRuta.getText();
                sql = "delete  from ruta where id=" + d;
                int resultado = BaseDeDatos.stmt.executeUpdate(sql);
                if (resultado == 1) {
                    JOptionPane.showMessageDialog(null, "El registro a sido eliminado", "Info", JOptionPane.INFORMATION_MESSAGE);
                }

            } catch (SQLException | HeadlessException e) {
                JOptionPane.showMessageDialog(null, "El registro no se pudo borrar", "Error", JOptionPane.ERROR_MESSAGE);
            }
        }
        BaseDeDatos.desconectarse();
        llenarRutas();
    }
//______________________________________________________________________________

    private void eliminarMarca() {

        BaseDeDatos.conectarse();
        if (tablaMarcas.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else if (JOptionPane.showConfirmDialog(null, "Esta seguro de que desea eliminar este registro",
                "Advertencia", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_NO_OPTION) {
            try {

                lblIdMarca.setText("" + tablaMarcas.getValueAt(tablaMarcas.getSelectedRow(), 0));
                String d = lblIdMarca.getText();
                sql = "delete  from marca where id=" + d;
                int resultado = BaseDeDatos.stmt.executeUpdate(sql);
                if (resultado == 1) {
                    JOptionPane.showMessageDialog(null, "El registro a sido eliminado", "Info", JOptionPane.INFORMATION_MESSAGE);
                }

            } catch (SQLException | HeadlessException e) {
                JOptionPane.showMessageDialog(null, "El registro no se pudo borrar", "Error", JOptionPane.ERROR_MESSAGE);
            }
        }
        BaseDeDatos.desconectarse();
        llenarMarcas();
    }
//______________________________________________________________________________

    private void eliminarTipos() {

        BaseDeDatos.conectarse();
        if (tablaTipos.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else if (JOptionPane.showConfirmDialog(null, "Esta seguro de que desea eliminar este registro",
                "Advertencia", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_NO_OPTION) {
            try {

                lblIdTipo.setText("" + tablaTipos.getValueAt(tablaTipos.getSelectedRow(), 0));
                String d = lblIdTipo.getText();
                sql = "delete  from tipo where id=" + d;
                int resultado = BaseDeDatos.stmt.executeUpdate(sql);
                if (resultado == 1) {
                    JOptionPane.showMessageDialog(null, "El registro a sido eliminado", "Info", JOptionPane.INFORMATION_MESSAGE);
                }

            } catch (SQLException | HeadlessException e) {
                JOptionPane.showMessageDialog(null, "El registro no se pudo borrar", "Error", JOptionPane.ERROR_MESSAGE);
            }
        }
        BaseDeDatos.desconectarse();
        llenarTipos();
    }
//______________________________________________________________________________

    private void eliminarPropietario() {

        BaseDeDatos.conectarse();
        if (tablaPropietarios.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else if (JOptionPane.showConfirmDialog(null, "Esta seguro de que desea eliminar este registro",
                "Advertencia", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_NO_OPTION) {
            try {

                lblIdPropietario.setText("" + tablaPropietarios.getValueAt(tablaPropietarios.getSelectedRow(), 3));
                String d = lblIdPropietario.getText();
                sql = "delete from propietario where cedula=" + d;
                int resultado = BaseDeDatos.stmt.executeUpdate(sql);
                if (resultado == 1) {
                    JOptionPane.showMessageDialog(null, "El registro a sido eliminado", "Info", JOptionPane.INFORMATION_MESSAGE);
                }

            } catch (SQLException | HeadlessException e) {
                JOptionPane.showMessageDialog(null, "El registro no se pudo borrar", "Error", JOptionPane.ERROR_MESSAGE);
                System.out.println(e.getMessage());
                System.out.println(sql);
            }
        }
        BaseDeDatos.desconectarse();
        llenarPropietarios("");
    }
//______________________________________________________________________________

    private void modificarRutas() {

        BaseDeDatos.conectarse();
        if (JOptionPane.showConfirmDialog(null, "Esta seguro de que desea modificar este registro",
                "Advertencia", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_NO_OPTION) {
            try {

                String d = lblIdRuta.getText();
                String a = txtNuevaRuta.getText();
                sql = "update ruta set ruta='" + a.toUpperCase() + "'where id=" + d;
                int resultado = BaseDeDatos.stmt.executeUpdate(sql);
                if (resultado == 1) {
                    JOptionPane.showMessageDialog(null, "El registro a sido modificado exitosamente", "Info", JOptionPane.INFORMATION_MESSAGE);
                }

            } catch (SQLException | HeadlessException e) {
                JOptionPane.showMessageDialog(null, "El registro no se pudo  modificar", "Error", JOptionPane.ERROR_MESSAGE);
            }
        }
        BaseDeDatos.desconectarse();
        llenarRutas();
    }
//______________________________________________________________________________

    private void modificarMarcas() {

        BaseDeDatos.conectarse();
        if (JOptionPane.showConfirmDialog(null, "Esta seguro de que desea modificar este registro",
                "Advertencia", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_NO_OPTION) {
            try {

                String d = lblIdMarca.getText();
                String a = txtNuevaMarca.getText();
                sql = "update marca set marca='" + a.toUpperCase() + "'where id=" + d;
                int resultado = BaseDeDatos.stmt.executeUpdate(sql);
                if (resultado == 1) {
                    JOptionPane.showMessageDialog(null, "El registro a sido modificado exitosamente", "Info", JOptionPane.INFORMATION_MESSAGE);
                }

            } catch (SQLException | HeadlessException e) {
                JOptionPane.showMessageDialog(null, "El registro no se pudo  modificar", "Error", JOptionPane.ERROR_MESSAGE);
            }
        }
        BaseDeDatos.desconectarse();
        llenarMarcas();
    }
//______________________________________________________________________________

    private void modificarTipos() {

        BaseDeDatos.conectarse();
        if (JOptionPane.showConfirmDialog(null, "Esta seguro de que desea modificar este registro",
                "Advertencia", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_NO_OPTION) {
            try {

                String d = lblIdTipo.getText();
                String a = txtNuevoTipo.getText();
                sql = "update tipo set tipo='" + a.toUpperCase() + "'where id=" + d;
                int resultado = BaseDeDatos.stmt.executeUpdate(sql);
                if (resultado == 1) {
                    JOptionPane.showMessageDialog(null, "El registro a sido modificado exitosamente", "Info", JOptionPane.INFORMATION_MESSAGE);
                }

            } catch (SQLException | HeadlessException e) {
                JOptionPane.showMessageDialog(null, "El registro no se pudo  modificar", "Error", JOptionPane.ERROR_MESSAGE);
            }
        }
        BaseDeDatos.desconectarse();
        llenarTipos();
    }
//______________________________________________________________________________

    private void modificarPropietarios() {

        BaseDeDatos.conectarse();
        if (JOptionPane.showConfirmDialog(null, "Esta seguro de que desea modificar este registro",
                "Advertencia", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_NO_OPTION) {
            try {

                String x = lblIdPropietario.getText();
                String a = txtNuevosNombre.getText();
                String b = txtNuevosApellido.getText();
                String c = txtNuevaCedula.getText();
                String d = txtNuevaDireccion.getText();
                String e = txtNuevoTelefono.getText();

                sql = "update propietario set nombre_completo='" + a.toLowerCase() + " " + b.toLowerCase() + "', nombre='" + a.toLowerCase() + "', apellido='" + b.toLowerCase() + "', cedula=" + c + ", direccion='" + d.toLowerCase() + "', telefono=" + e + " where cedula=" + x;
                int resultado = BaseDeDatos.stmt.executeUpdate(sql);
                if (resultado == 1) {
                    JOptionPane.showMessageDialog(null, "El registro a sido modificado exitosamente", "Info", JOptionPane.INFORMATION_MESSAGE);
                }

            } catch (SQLException | HeadlessException e) {
                JOptionPane.showMessageDialog(null, "El registro no se pudo modificar, la cedula ya existe", "Error", JOptionPane.ERROR_MESSAGE);
                System.out.println(e.getMessage());
                System.out.println(sql);
            }
        }
        BaseDeDatos.desconectarse();
        llenarPropietarios("");


    }
//______________________________________________________________________________

    public class hiloRutas implements Runnable {

        @Override
        @SuppressWarnings("SleepWhileInLoop")
        public void run() {
            for (int i = 0; i <= 100; i++) {
                try {
                    pbCargarDatos.setValue(i);
                    pbCargarDatos.repaint();
                    Thread.sleep(10);
                    if (pbCargarDatos.getValue() == 1) {
                        llenarRutas();
                    } else if (pbCargarDatos.getValue() == 100) {
                        pbCargarDatos.setValue(0);
                        dlgCargandoDatos.dispose();
                        dlgRutas.setLocationRelativeTo(null);
                        dlgRutas.setVisible(true);
                    }
                } catch (InterruptedException e) {
                    JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
                }
            }
        }
    }
//______________________________________________________________________________

    public class hiloMarcas implements Runnable {

        @Override
        @SuppressWarnings("SleepWhileInLoop")
        public void run() {
            for (int i = 0; i <= 100; i++) {
                try {
                    pbCargarDatos.setValue(i);
                    pbCargarDatos.repaint();
                    Thread.sleep(10);
                    if (pbCargarDatos.getValue() == 1) {
                        llenarMarcas();
                    } else if (pbCargarDatos.getValue() == 100) {
                        pbCargarDatos.setValue(0);
                        dlgCargandoDatos.dispose();
                        dlgMarcas.setLocationRelativeTo(null);
                        dlgMarcas.setVisible(true);
                    }
                } catch (InterruptedException e) {
                    JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
                }
            }
        }
    }
//______________________________________________________________________________

    public class hiloTipos implements Runnable {

        @Override
        @SuppressWarnings("SleepWhileInLoop")
        public void run() {
            for (int i = 0; i <= 100; i++) {
                try {
                    pbCargarDatos.setValue(i);
                    pbCargarDatos.repaint();
                    Thread.sleep(10);
                    if (pbCargarDatos.getValue() == 1) {
                        llenarTipos();
                    } else if (pbCargarDatos.getValue() == 100) {
                        pbCargarDatos.setValue(0);
                        dlgCargandoDatos.dispose();
                        dlgTipos.setLocationRelativeTo(null);
                        dlgTipos.setVisible(true);
                    }
                } catch (InterruptedException e) {
                    JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
                }
            }
        }
    }
//______________________________________________________________________________

    public class hiloPropietarios implements Runnable {

        @Override
        @SuppressWarnings("SleepWhileInLoop")
        public void run() {
            for (int i = 0; i <= 100; i++) {
                try {
                    pbCargarDatos.setValue(i);
                    pbCargarDatos.repaint();
                    Thread.sleep(10);
                    if (pbCargarDatos.getValue() == 1) {
                        llenarPropietarios("");
                    } else if (pbCargarDatos.getValue() == 100) {
                        pbCargarDatos.setValue(0);
                        dlgCargandoDatos.dispose();
                        dlgPropietarios.setLocationRelativeTo(null);
                        dlgPropietarios.setVisible(true);
                    }
                } catch (InterruptedException e) {
                    JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
                }
            }
        }
    }
//______________________________________________________________________________

    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        dlgRutas = new javax.swing.JDialog();
        jPanel4 = new javax.swing.JPanel();
        btnEliminarRuta = new javax.swing.JButton();
        btnModificarRuta = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        tablaRutas = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int colIndex) {
                return false; //Disallow the editing of any cell
            }
        };
        lblIdRuta = new javax.swing.JLabel();
        dlgMarcas = new javax.swing.JDialog();
        jPanel5 = new javax.swing.JPanel();
        btnEliminarMarcas = new javax.swing.JButton();
        btnModificarMarcas = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        tablaMarcas = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int colIndex) {
                return false; //Disallow the editing of any cell
            }
        };
        lblIdMarca = new javax.swing.JLabel();
        dlgTipos = new javax.swing.JDialog();
        jPanel6 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        tablaTipos = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int colIndex) {
                return false; //Disallow the editing of any cell
            }
        };
        btnEliminarTipo = new javax.swing.JButton();
        btnModificarTipos = new javax.swing.JButton();
        lblIdTipo = new javax.swing.JLabel();
        dlgModificarRutas = new javax.swing.JDialog();
        jPanel7 = new javax.swing.JPanel();
        btnAceptarRuta = new javax.swing.JButton();
        jLabel8 = new javax.swing.JLabel();
        txtNuevaRuta = new javax.swing.JTextField();
        dlgModificarMarcas = new javax.swing.JDialog();
        jPanel8 = new javax.swing.JPanel();
        jLabel9 = new javax.swing.JLabel();
        txtNuevaMarca = new javax.swing.JTextField();
        btnAceptarMarca = new javax.swing.JButton();
        dlgModificarTipos = new javax.swing.JDialog();
        jPanel9 = new javax.swing.JPanel();
        txtNuevoTipo = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        btnAceptarTipo = new javax.swing.JButton();
        dlgPropietarios = new javax.swing.JDialog();
        jPanel11 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        tablaPropietarios = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int colIndex) {
                return false; //Disallow the editing of any cell
            }
        };
        btnEliminarPropietarios = new javax.swing.JButton();
        btnModificarPropietarios = new javax.swing.JButton();
        lblIdPropietario = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        txtBuscar = new javax.swing.JTextField();
        cbxFiltro = new javax.swing.JComboBox();
        dlgModificarPropietarios = new javax.swing.JDialog();
        jPanel12 = new javax.swing.JPanel();
        txtNuevaCedula = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        btnAceptarPropietario = new javax.swing.JButton();
        jLabel13 = new javax.swing.JLabel();
        txtNuevosNombre = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        txtNuevosApellido = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        txtNuevaDireccion = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        txtNuevoTelefono = new javax.swing.JTextField();
        dlgCargandoDatos = new javax.swing.JDialog();
        pbCargarDatos = new javax.swing.JProgressBar();
        jPanel1 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        txtRuta = new javax.swing.JTextField();
        btnIngresarRuta = new javax.swing.JButton();
        btnVerTablaRutas = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        txtMarca = new javax.swing.JTextField();
        btnIngresarMarca = new javax.swing.JButton();
        btnVerTablaMarcas = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        txtTipo = new javax.swing.JTextField();
        btnIngresarTipo = new javax.swing.JButton();
        btnVerTablaTipos = new javax.swing.JButton();
        jPanel10 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        txtNombre = new javax.swing.JTextField();
        txtApellido = new javax.swing.JTextField();
        txtCedula = new javax.swing.JTextField();
        txtDireccion = new javax.swing.JTextField();
        txtTelefono = new javax.swing.JTextField();
        btnIngresarPropietario = new javax.swing.JButton();
        btnVerTablaPropietarios = new javax.swing.JButton();
        jLabel17 = new javax.swing.JLabel();

        dlgRutas.setTitle("Rutas");
        dlgRutas.setMinimumSize(new java.awt.Dimension(523, 404));
        dlgRutas.setModal(true);
        dlgRutas.setResizable(false);

        btnEliminarRuta.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnEliminarRuta.setText("Eliminar");
        btnEliminarRuta.setBorder(null);
        btnEliminarRuta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEliminarRutaActionPerformed(evt);
            }
        });

        btnModificarRuta.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnModificarRuta.setText("Modificar");
        btnModificarRuta.setBorder(null);
        btnModificarRuta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnModificarRutaActionPerformed(evt);
            }
        });

        tablaRutas.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        tablaRutas.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        tablaRutas.setToolTipText("");
        tablaRutas.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
        tablaRutas.setIntercellSpacing(new java.awt.Dimension(0, 0));
        tablaRutas.setRowHeight(24);
        tablaRutas.getTableHeader().setReorderingAllowed(false);
        jScrollPane1.setViewportView(tablaRutas);

        lblIdRuta.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblIdRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(btnEliminarRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnModificarRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblIdRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 483, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 325, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblIdRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(btnEliminarRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(btnModificarRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );

        javax.swing.GroupLayout dlgRutasLayout = new javax.swing.GroupLayout(dlgRutas.getContentPane());
        dlgRutas.getContentPane().setLayout(dlgRutasLayout);
        dlgRutasLayout.setHorizontalGroup(
            dlgRutasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgRutasLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        dlgRutasLayout.setVerticalGroup(
            dlgRutasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgRutasLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        dlgMarcas.setTitle("Marcas");
        dlgMarcas.setMinimumSize(new java.awt.Dimension(523, 404));
        dlgMarcas.setModal(true);
        dlgMarcas.setResizable(false);

        btnEliminarMarcas.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnEliminarMarcas.setText("Eliminar");
        btnEliminarMarcas.setBorder(null);
        btnEliminarMarcas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEliminarMarcasActionPerformed(evt);
            }
        });

        btnModificarMarcas.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnModificarMarcas.setText("Modificar");
        btnModificarMarcas.setBorder(null);
        btnModificarMarcas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnModificarMarcasActionPerformed(evt);
            }
        });

        tablaMarcas.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        tablaMarcas.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        tablaMarcas.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
        tablaMarcas.setRowHeight(24);
        tablaMarcas.getTableHeader().setReorderingAllowed(false);
        jScrollPane2.setViewportView(tablaMarcas);

        lblIdMarca.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(btnEliminarMarcas, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnModificarMarcas, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblIdMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 483, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 325, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnEliminarMarcas, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnModificarMarcas, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblIdMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout dlgMarcasLayout = new javax.swing.GroupLayout(dlgMarcas.getContentPane());
        dlgMarcas.getContentPane().setLayout(dlgMarcasLayout);
        dlgMarcasLayout.setHorizontalGroup(
            dlgMarcasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgMarcasLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        dlgMarcasLayout.setVerticalGroup(
            dlgMarcasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgMarcasLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        dlgTipos.setTitle("Tipos");
        dlgTipos.setMinimumSize(new java.awt.Dimension(523, 404));
        dlgTipos.setModal(true);
        dlgTipos.setResizable(false);

        tablaTipos.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        tablaTipos.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        tablaTipos.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
        tablaTipos.setRowHeight(24);
        tablaTipos.getTableHeader().setReorderingAllowed(false);
        jScrollPane3.setViewportView(tablaTipos);

        btnEliminarTipo.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnEliminarTipo.setText("Eliminar");
        btnEliminarTipo.setBorder(null);
        btnEliminarTipo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEliminarTipoActionPerformed(evt);
            }
        });

        btnModificarTipos.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnModificarTipos.setText("Modificar");
        btnModificarTipos.setBorder(null);
        btnModificarTipos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnModificarTiposActionPerformed(evt);
            }
        });

        lblIdTipo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addComponent(btnEliminarTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnModificarTipos, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblIdTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 483, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 325, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnEliminarTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnModificarTipos, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblIdTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout dlgTiposLayout = new javax.swing.GroupLayout(dlgTipos.getContentPane());
        dlgTipos.getContentPane().setLayout(dlgTiposLayout);
        dlgTiposLayout.setHorizontalGroup(
            dlgTiposLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgTiposLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        dlgTiposLayout.setVerticalGroup(
            dlgTiposLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgTiposLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        dlgModificarRutas.setTitle("Modificar Ruta");
        dlgModificarRutas.setMinimumSize(new java.awt.Dimension(400, 123));
        dlgModificarRutas.setModal(true);
        dlgModificarRutas.setResizable(false);

        jPanel7.setMaximumSize(new java.awt.Dimension(380, 83));
        jPanel7.setMinimumSize(new java.awt.Dimension(380, 83));

        btnAceptarRuta.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnAceptarRuta.setText("Acceptar");
        btnAceptarRuta.setBorder(null);
        btnAceptarRuta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAceptarRutaActionPerformed(evt);
            }
        });

        jLabel8.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel8.setText("Ruta:");
        jLabel8.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        txtNuevaRuta.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNuevaRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtNuevaRuta.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        txtNuevaRuta.setMargin(new java.awt.Insets(0, 5, 0, 5));

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(btnAceptarRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 260, Short.MAX_VALUE))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jLabel8)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtNuevaRuta, javax.swing.GroupLayout.DEFAULT_SIZE, 321, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNuevaRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(btnAceptarRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        javax.swing.GroupLayout dlgModificarRutasLayout = new javax.swing.GroupLayout(dlgModificarRutas.getContentPane());
        dlgModificarRutas.getContentPane().setLayout(dlgModificarRutasLayout);
        dlgModificarRutasLayout.setHorizontalGroup(
            dlgModificarRutasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgModificarRutasLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        dlgModificarRutasLayout.setVerticalGroup(
            dlgModificarRutasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgModificarRutasLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(30, Short.MAX_VALUE))
        );

        dlgModificarMarcas.setTitle("Modificar Marca");
        dlgModificarMarcas.setMinimumSize(new java.awt.Dimension(400, 123));
        dlgModificarMarcas.setModal(true);
        dlgModificarMarcas.setResizable(false);

        jLabel9.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel9.setText("Marca:");

        txtNuevaMarca.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNuevaMarca.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtNuevaMarca.setMargin(new java.awt.Insets(0, 5, 0, 5));

        btnAceptarMarca.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnAceptarMarca.setText("Aceptar");
        btnAceptarMarca.setBorder(null);
        btnAceptarMarca.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAceptarMarcaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtNuevaMarca, javax.swing.GroupLayout.DEFAULT_SIZE, 317, Short.MAX_VALUE))
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(btnAceptarMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 260, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNuevaMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(btnAceptarMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout dlgModificarMarcasLayout = new javax.swing.GroupLayout(dlgModificarMarcas.getContentPane());
        dlgModificarMarcas.getContentPane().setLayout(dlgModificarMarcasLayout);
        dlgModificarMarcasLayout.setHorizontalGroup(
            dlgModificarMarcasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgModificarMarcasLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        dlgModificarMarcasLayout.setVerticalGroup(
            dlgModificarMarcasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgModificarMarcasLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(30, Short.MAX_VALUE))
        );

        dlgModificarTipos.setTitle("Modificar Tipo");
        dlgModificarTipos.setMinimumSize(new java.awt.Dimension(400, 123));
        dlgModificarTipos.setModal(true);
        dlgModificarTipos.setResizable(false);

        txtNuevoTipo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtNuevoTipo.setMargin(new java.awt.Insets(0, 5, 0, 5));

        jLabel10.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel10.setText("Tipo:");

        btnAceptarTipo.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnAceptarTipo.setText("Aceptar");
        btnAceptarTipo.setBorder(null);
        btnAceptarTipo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAceptarTipoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addComponent(jLabel10)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtNuevoTipo, javax.swing.GroupLayout.DEFAULT_SIZE, 323, Short.MAX_VALUE))
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addComponent(btnAceptarTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 260, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNuevoTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(btnAceptarTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout dlgModificarTiposLayout = new javax.swing.GroupLayout(dlgModificarTipos.getContentPane());
        dlgModificarTipos.getContentPane().setLayout(dlgModificarTiposLayout);
        dlgModificarTiposLayout.setHorizontalGroup(
            dlgModificarTiposLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgModificarTiposLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        dlgModificarTiposLayout.setVerticalGroup(
            dlgModificarTiposLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgModificarTiposLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(30, Short.MAX_VALUE))
        );

        dlgPropietarios.setTitle("Propietarios");
        dlgPropietarios.setMinimumSize(new java.awt.Dimension(795, 561));
        dlgPropietarios.setModal(true);
        dlgPropietarios.setResizable(false);

        tablaPropietarios.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        tablaPropietarios.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        tablaPropietarios.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
        tablaPropietarios.setRowHeight(24);
        tablaPropietarios.getTableHeader().setReorderingAllowed(false);
        jScrollPane4.setViewportView(tablaPropietarios);

        btnEliminarPropietarios.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnEliminarPropietarios.setText("Eliminar");
        btnEliminarPropietarios.setBorder(null);
        btnEliminarPropietarios.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEliminarPropietariosActionPerformed(evt);
            }
        });

        btnModificarPropietarios.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnModificarPropietarios.setText("Modificar");
        btnModificarPropietarios.setBorder(null);
        btnModificarPropietarios.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnModificarPropietariosActionPerformed(evt);
            }
        });

        lblIdPropietario.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel18.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel18.setText("Filtrar por:");

        txtBuscar.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtBuscar.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtBuscar.setMargin(new java.awt.Insets(0, 5, 0, 5));
        txtBuscar.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                txtBuscarKeyReleased(evt);
            }
        });

        cbxFiltro.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        cbxFiltro.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Nombre", "Cedula" }));
        cbxFiltro.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        cbxFiltro.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                cbxFiltroItemStateChanged(evt);
            }
        });

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 755, Short.MAX_VALUE)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(btnEliminarPropietarios, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnModificarPropietarios, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblIdPropietario, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 521, Short.MAX_VALUE))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(10, 10, 10)
                        .addComponent(cbxFiltro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(10, 10, 10)
                        .addComponent(txtBuscar, javax.swing.GroupLayout.DEFAULT_SIZE, 599, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtBuscar, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cbxFiltro, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 448, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnEliminarPropietarios, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnModificarPropietarios, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblIdPropietario, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(11, 11, 11))
        );

        javax.swing.GroupLayout dlgPropietariosLayout = new javax.swing.GroupLayout(dlgPropietarios.getContentPane());
        dlgPropietarios.getContentPane().setLayout(dlgPropietariosLayout);
        dlgPropietariosLayout.setHorizontalGroup(
            dlgPropietariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgPropietariosLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        dlgPropietariosLayout.setVerticalGroup(
            dlgPropietariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgPropietariosLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        dlgPropietarios.getAccessibleContext().setAccessibleName("Dueños");

        dlgModificarPropietarios.setTitle("Modificar Propietario");
        dlgModificarPropietarios.setMinimumSize(new java.awt.Dimension(307, 300));
        dlgModificarPropietarios.setModal(true);
        dlgModificarPropietarios.setResizable(false);

        txtNuevaCedula.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNuevaCedula.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtNuevaCedula.setMargin(new java.awt.Insets(0, 5, 0, 5));

        jLabel12.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel12.setText("Cedula:");

        btnAceptarPropietario.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnAceptarPropietario.setText("Aceptar");
        btnAceptarPropietario.setBorder(null);
        btnAceptarPropietario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAceptarPropietarioActionPerformed(evt);
            }
        });

        jLabel13.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel13.setText("Nombre:");

        txtNuevosNombre.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNuevosNombre.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtNuevosNombre.setMargin(new java.awt.Insets(0, 5, 0, 5));

        jLabel14.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel14.setText("Apellidos:");

        txtNuevosApellido.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNuevosApellido.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtNuevosApellido.setMargin(new java.awt.Insets(0, 5, 0, 5));

        jLabel15.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel15.setText("Direccion:");

        txtNuevaDireccion.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNuevaDireccion.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtNuevaDireccion.setMargin(new java.awt.Insets(0, 5, 0, 5));

        jLabel16.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel16.setText("Teléfono:");

        txtNuevoTelefono.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNuevoTelefono.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtNuevoTelefono.setMargin(new java.awt.Insets(0, 5, 0, 5));

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel12Layout.createSequentialGroup()
                .addGap(15, 15, 15)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel12Layout.createSequentialGroup()
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jLabel12, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel13, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel14, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel15, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 60, Short.MAX_VALUE))
                        .addGap(10, 10, 10)
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel12Layout.createSequentialGroup()
                                .addComponent(txtNuevaCedula, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addGroup(jPanel12Layout.createSequentialGroup()
                                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txtNuevaDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txtNuevosApellido, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txtNuevosNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addContainerGap())))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel12Layout.createSequentialGroup()
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(btnAceptarPropietario, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel12Layout.createSequentialGroup()
                                .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(10, 10, 10)
                                .addComponent(txtNuevoTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap(60, Short.MAX_VALUE))))
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addGap(15, 15, 15)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNuevosNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNuevosApellido, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNuevaCedula, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNuevaDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNuevoTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(20, 20, 20)
                .addComponent(btnAceptarPropietario, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(15, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout dlgModificarPropietariosLayout = new javax.swing.GroupLayout(dlgModificarPropietarios.getContentPane());
        dlgModificarPropietarios.getContentPane().setLayout(dlgModificarPropietariosLayout);
        dlgModificarPropietariosLayout.setHorizontalGroup(
            dlgModificarPropietariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgModificarPropietariosLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(12, Short.MAX_VALUE))
        );
        dlgModificarPropietariosLayout.setVerticalGroup(
            dlgModificarPropietariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgModificarPropietariosLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(31, Short.MAX_VALUE))
        );

        dlgCargandoDatos.setTitle("Cargando datos...");
        dlgCargandoDatos.setMinimumSize(new java.awt.Dimension(267, 72));
        dlgCargandoDatos.setModal(true);
        dlgCargandoDatos.setResizable(false);
        dlgCargandoDatos.setType(java.awt.Window.Type.UTILITY);

        pbCargarDatos.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        javax.swing.GroupLayout dlgCargandoDatosLayout = new javax.swing.GroupLayout(dlgCargandoDatos.getContentPane());
        dlgCargandoDatos.getContentPane().setLayout(dlgCargandoDatosLayout);
        dlgCargandoDatosLayout.setHorizontalGroup(
            dlgCargandoDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgCargandoDatosLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pbCargarDatos, javax.swing.GroupLayout.PREFERRED_SIZE, 247, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        dlgCargandoDatosLayout.setVerticalGroup(
            dlgCargandoDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgCargandoDatosLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pbCargarDatos, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(37, Short.MAX_VALUE))
        );

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)), "Ingresar Nueva Ruta", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 0, 14))); // NOI18N
        jPanel1.setPreferredSize(new java.awt.Dimension(500, 113));

        jLabel5.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel5.setText("Ruta:");

        txtRuta.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtRuta.setMargin(new java.awt.Insets(0, 5, 0, 5));

        btnIngresarRuta.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnIngresarRuta.setText("Ingresar");
        btnIngresarRuta.setBorder(null);
        btnIngresarRuta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnIngresarRutaActionPerformed(evt);
            }
        });

        btnVerTablaRutas.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnVerTablaRutas.setText("Ver Tabla");
        btnVerTablaRutas.setBorder(null);
        btnVerTablaRutas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnVerTablaRutasActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txtRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnIngresarRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnVerTablaRutas, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(14, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(15, 15, 15)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnIngresarRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnVerTablaRutas, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(15, Short.MAX_VALUE))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)), "Ingresar Nueva Marca", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 0, 14))); // NOI18N
        jPanel2.setPreferredSize(new java.awt.Dimension(500, 113));

        jLabel7.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel7.setText("Marca:");

        txtMarca.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtMarca.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtMarca.setMargin(new java.awt.Insets(0, 5, 0, 5));

        btnIngresarMarca.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnIngresarMarca.setText("Ingresar");
        btnIngresarMarca.setBorder(null);
        btnIngresarMarca.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnIngresarMarcaActionPerformed(evt);
            }
        });

        btnVerTablaMarcas.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnVerTablaMarcas.setText("Ver Tabla");
        btnVerTablaMarcas.setBorder(null);
        btnVerTablaMarcas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnVerTablaMarcasActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txtMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnIngresarMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnVerTablaMarcas, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(14, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(15, 15, 15)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnIngresarMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnVerTablaMarcas, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15))
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)), "Ingresar Nuevo Tipo de Vehiculo", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 0, 14))); // NOI18N
        jPanel3.setPreferredSize(new java.awt.Dimension(505, 112));

        jLabel2.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel2.setText("Tipo:");

        txtTipo.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtTipo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtTipo.setMargin(new java.awt.Insets(0, 5, 0, 5));

        btnIngresarTipo.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnIngresarTipo.setText("Ingresar");
        btnIngresarTipo.setBorder(null);
        btnIngresarTipo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnIngresarTipoActionPerformed(evt);
            }
        });

        btnVerTablaTipos.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnVerTablaTipos.setText("Ver Tabla");
        btnVerTablaTipos.setBorder(null);
        btnVerTablaTipos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnVerTablaTiposActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txtTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnIngresarTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnVerTablaTipos, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(19, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(15, 15, 15)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnVerTablaTipos, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnIngresarTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)), "Ingresar nuevo Propietario", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 14))); // NOI18N
        jPanel10.setPreferredSize(new java.awt.Dimension(502, 450));

        jLabel1.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel1.setText("Nombres:");

        jLabel3.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel3.setText("Apellido:");

        jLabel4.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel4.setText("Cedula:");

        jLabel6.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel6.setText("Direccion:");

        jLabel11.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel11.setText("Telefono:");

        txtNombre.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNombre.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtNombre.setMargin(new java.awt.Insets(0, 5, 0, 5));

        txtApellido.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtApellido.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtApellido.setMargin(new java.awt.Insets(0, 5, 0, 5));

        txtCedula.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtCedula.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtCedula.setMargin(new java.awt.Insets(0, 5, 0, 5));

        txtDireccion.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtDireccion.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtDireccion.setMargin(new java.awt.Insets(0, 5, 0, 5));

        txtTelefono.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtTelefono.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtTelefono.setMargin(new java.awt.Insets(0, 5, 0, 5));

        btnIngresarPropietario.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnIngresarPropietario.setText("Ingresar");
        btnIngresarPropietario.setBorder(null);
        btnIngresarPropietario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnIngresarPropietarioActionPerformed(evt);
            }
        });

        btnVerTablaPropietarios.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnVerTablaPropietarios.setText("Ver Tabla");
        btnVerTablaPropietarios.setBorder(null);
        btnVerTablaPropietarios.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnVerTablaPropietariosActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                .addContainerGap(85, Short.MAX_VALUE)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel10Layout.createSequentialGroup()
                        .addComponent(btnIngresarPropietario, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnVerTablaPropietarios, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel10Layout.createSequentialGroup()
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 70, Short.MAX_VALUE)))
                        .addGap(10, 10, 10)
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtCedula, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txtTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txtApellido, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txtDireccion, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addComponent(txtNombre, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addContainerGap(86, Short.MAX_VALUE))
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addGap(15, 15, 15)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtApellido, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtCedula, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnVerTablaPropietarios, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnIngresarPropietario, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jLabel17.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel17.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/logo.png"))); // NOI18N
        jLabel17.setMaximumSize(new java.awt.Dimension(953, 132));
        jLabel17.setMinimumSize(new java.awt.Dimension(953, 132));
        jLabel17.setPreferredSize(new java.awt.Dimension(953, 132));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 960, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, 451, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(26, 26, 26)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(20, 20, 20)
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, 270, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(233, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents
//______________________________________________________________________________

    private void btnVerTablaRutasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVerTablaRutasActionPerformed

        new Thread(new hiloRutas()).start();
        dlgCargandoDatos.setLocationRelativeTo(null);
        dlgCargandoDatos.setVisible(true);
        lblIdRuta.setVisible(false);
        tablaRutas.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tablaRutas.setAutoCreateRowSorter(true);

    }//GEN-LAST:event_btnVerTablaRutasActionPerformed
//______________________________________________________________________________

    private void btnVerTablaMarcasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVerTablaMarcasActionPerformed

        new Thread(new hiloMarcas()).start();
        dlgCargandoDatos.setLocationRelativeTo(null);
        dlgCargandoDatos.setVisible(true);
        lblIdMarca.setVisible(false);
        tablaMarcas.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tablaMarcas.setAutoCreateRowSorter(true);

    }//GEN-LAST:event_btnVerTablaMarcasActionPerformed
//______________________________________________________________________________

    private void btnVerTablaTiposActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVerTablaTiposActionPerformed

        new Thread(new hiloTipos()).start();
        dlgCargandoDatos.setLocationRelativeTo(null);
        dlgCargandoDatos.setVisible(true);
        lblIdTipo.setVisible(false);
        tablaTipos.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tablaTipos.setAutoCreateRowSorter(true);

    }//GEN-LAST:event_btnVerTablaTiposActionPerformed
//______________________________________________________________________________

    private void btnIngresarRutaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnIngresarRutaActionPerformed

        String ruta = txtRuta.getText();
        if (ValidacionesOpciones.validaRuta(ruta, txtRuta)) {
            JOptionPane.showMessageDialog(jPanel1, "Por favor indique una ruta válida\nEjemplo: Roldanillo - Cali", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            insertarRuta();
            txtRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        }

    }//GEN-LAST:event_btnIngresarRutaActionPerformed
//______________________________________________________________________________

    private void btnIngresarMarcaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnIngresarMarcaActionPerformed

        String marca = txtMarca.getText();
        if (ValidacionesOpciones.validaMarca(marca, txtMarca)) {
            JOptionPane.showMessageDialog(jPanel2, "Por favor indique una marca valida", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            insertarMarca();
            txtMarca.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        }

    }//GEN-LAST:event_btnIngresarMarcaActionPerformed
//______________________________________________________________________________

    private void btnIngresarTipoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnIngresarTipoActionPerformed

        String tipo = txtTipo.getText();
        if (ValidacionesPropietario.ValidacionesNomApe(tipo, txtTipo)) {
            JOptionPane.showMessageDialog(jPanel3, "Por favor indique un tipo de vehiculo válido", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            insertarTipo();
            txtTipo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        }

    }//GEN-LAST:event_btnIngresarTipoActionPerformed
//______________________________________________________________________________

    private void btnEliminarRutaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarRutaActionPerformed

        eliminarRuta();

    }//GEN-LAST:event_btnEliminarRutaActionPerformed
//______________________________________________________________________________

    private void btnEliminarMarcasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarMarcasActionPerformed

        eliminarMarca();

    }//GEN-LAST:event_btnEliminarMarcasActionPerformed
//______________________________________________________________________________

    private void btnEliminarTipoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarTipoActionPerformed

        eliminarTipos();

    }//GEN-LAST:event_btnEliminarTipoActionPerformed
//______________________________________________________________________________

    private void btnModificarRutaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnModificarRutaActionPerformed

        if (tablaRutas.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            lblIdRuta.setText("" + tablaRutas.getValueAt(tablaRutas.getSelectedRow(), 0));
            txtNuevaRuta.setText("" + tablaRutas.getValueAt(tablaRutas.getSelectedRow(), 1));
            dlgModificarRutas.setLocationRelativeTo(null);
            dlgModificarRutas.setVisible(true);
        }

    }//GEN-LAST:event_btnModificarRutaActionPerformed
//______________________________________________________________________________

    @SuppressWarnings("UnusedAssignment")
    private void btnAceptarRutaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAceptarRutaActionPerformed

        String nuevaRuta = txtNuevaRuta.getText();
        boolean valida = true;
        while (valida) {
            if (ValidacionesOpciones.validaRuta(nuevaRuta, txtNuevaRuta)) {
                valida = false;
                JOptionPane.showMessageDialog(jPanel7, "Por favor verifique los datos ingresados", "Error", JOptionPane.ERROR_MESSAGE);
            } else {
                ValidacionesAccidentes.pintarNegro(txtNuevaRuta);
                modificarRutas();
                dlgModificarRutas.setVisible(false);
            }
            valida = false;
        }

    }//GEN-LAST:event_btnAceptarRutaActionPerformed
//______________________________________________________________________________

    private void btnModificarMarcasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnModificarMarcasActionPerformed

        if (tablaMarcas.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            lblIdMarca.setText("" + tablaMarcas.getValueAt(tablaMarcas.getSelectedRow(), 0));
            txtNuevaMarca.setText("" + tablaMarcas.getValueAt(tablaMarcas.getSelectedRow(), 1));
            dlgModificarMarcas.setLocationRelativeTo(null);
            dlgModificarMarcas.setVisible(true);
        }

    }//GEN-LAST:event_btnModificarMarcasActionPerformed
//______________________________________________________________________________

    private void btnAceptarMarcaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAceptarMarcaActionPerformed

        String nuevaMarca = txtNuevaMarca.getText();
        if (ValidacionesOpciones.validaMarca(nuevaMarca, txtNuevaMarca)) {
            JOptionPane.showMessageDialog(dlgModificarMarcas, "Por favor indique una marca valida", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            modificarMarcas();
            dlgModificarMarcas.setVisible(false);
            txtNuevaMarca.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        }

    }//GEN-LAST:event_btnAceptarMarcaActionPerformed
//______________________________________________________________________________

    private void btnModificarTiposActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnModificarTiposActionPerformed

        if (tablaTipos.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            lblIdTipo.setText("" + tablaTipos.getValueAt(tablaTipos.getSelectedRow(), 0));
            txtNuevoTipo.setText("" + tablaTipos.getValueAt(tablaTipos.getSelectedRow(), 1));
            dlgModificarTipos.setLocationRelativeTo(null);
            dlgModificarTipos.setVisible(true);
        }

    }//GEN-LAST:event_btnModificarTiposActionPerformed
//______________________________________________________________________________

    private void btnAceptarTipoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAceptarTipoActionPerformed

        String nuevoTipo = txtNuevoTipo.getText();
        if (ValidacionesPropietario.ValidacionesNomApe(nuevoTipo, txtNuevoTipo)) {
            JOptionPane.showMessageDialog(dlgModificarTipos, "Por favor indique un tipo de vehiculo válido", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            modificarTipos();
            ValidacionesAccidentes.pintarNegro(txtNuevoTipo);
            dlgModificarTipos.setVisible(false);
        }

    }//GEN-LAST:event_btnAceptarTipoActionPerformed
//______________________________________________________________________________

private void btnEliminarPropietariosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarPropietariosActionPerformed

    eliminarPropietario();

}//GEN-LAST:event_btnEliminarPropietariosActionPerformed
//______________________________________________________________________________

private void btnModificarPropietariosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnModificarPropietariosActionPerformed

    txtNuevosNombre.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    txtNuevosApellido.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    txtNuevaCedula.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    txtNuevaDireccion.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    txtNuevoTelefono.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    if (tablaPropietarios.getSelectedRows().length < 1) {
        JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
    } else {
        lblIdPropietario.setText("" + tablaPropietarios.getValueAt(tablaPropietarios.getSelectedRow(), 3));
        txtNuevosNombre.setText("" + tablaPropietarios.getValueAt(tablaPropietarios.getSelectedRow(), 1));
        txtNuevosApellido.setText("" + tablaPropietarios.getValueAt(tablaPropietarios.getSelectedRow(), 2));
        txtNuevaCedula.setText("" + tablaPropietarios.getValueAt(tablaPropietarios.getSelectedRow(), 3));
        txtNuevaDireccion.setText("" + tablaPropietarios.getValueAt(tablaPropietarios.getSelectedRow(), 4));
        txtNuevoTelefono.setText("" + tablaPropietarios.getValueAt(tablaPropietarios.getSelectedRow(), 5));
        dlgModificarPropietarios.setLocationRelativeTo(null);
        dlgModificarPropietarios.setVisible(true);
    }

}//GEN-LAST:event_btnModificarPropietariosActionPerformed
//______________________________________________________________________________

    @SuppressWarnings("UnusedAssignment")
private void btnIngresarPropietarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnIngresarPropietarioActionPerformed

        String nombre = txtNombre.getText();
        String apellido = txtApellido.getText();
        String cedula = txtCedula.getText();
        String direccion = txtDireccion.getText();
        String telefono = txtTelefono.getText();
        boolean valida = true;
        while (valida) {

            if (ValidacionesPropietario.ValidacionesNomApe(nombre, txtNombre) || ValidacionesPropietario.ValidacionesNomApe(apellido, txtApellido)
                    || ValidacionesPropietario.validaCedula(cedula, txtCedula) || ValidacionesOpciones.validaDirecciones(direccion, txtDireccion) || ValidacionesPropietario.validaTelefono(telefono, txtTelefono)) {
                valida = false;
                JOptionPane.showMessageDialog(jPanel10, "Por favor verifique los datos ingresados", "Error", JOptionPane.ERROR_MESSAGE);

            } else {
                insertarPropietario();
                txtNombre.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
                txtApellido.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
                txtCedula.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
                txtDireccion.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
                txtTelefono.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
            }
            valida = false;
        }

}//GEN-LAST:event_btnIngresarPropietarioActionPerformed
//______________________________________________________________________________

private void btnVerTablaPropietariosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVerTablaPropietariosActionPerformed

    new Thread(new hiloPropietarios()).start();
    dlgCargandoDatos.setLocationRelativeTo(null);
    dlgCargandoDatos.setVisible(true);
    lblIdPropietario.setVisible(false);
    tablaPropietarios.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    tablaPropietarios.setAutoCreateRowSorter(true);

}//GEN-LAST:event_btnVerTablaPropietariosActionPerformed
//______________________________________________________________________________

    private void txtBuscarKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtBuscarKeyReleased

        llenarPropietarios(txtBuscar.getText());

    }//GEN-LAST:event_txtBuscarKeyReleased
//______________________________________________________________________________

    @SuppressWarnings("UnusedAssignment")
    private void btnAceptarPropietarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAceptarPropietarioActionPerformed

        String nuevoNombre = txtNuevosNombre.getText();
        String nuevoApellido = txtNuevosApellido.getText();
        String nuevoCedula = txtNuevaCedula.getText();
        String nuevoDireccion = txtNuevaDireccion.getText();
        String nuevoTelefono = txtNuevoTelefono.getText();
        boolean valida = true;
        while (valida) {

            if (ValidacionesPropietario.ValidacionesNomApe(nuevoNombre, txtNuevosNombre) || ValidacionesPropietario.ValidacionesNomApe(nuevoApellido, txtNuevosApellido)
                    || ValidacionesPropietario.validaCedula(nuevoCedula, txtNuevaCedula) || ValidacionesOpciones.validaDirecciones(nuevoDireccion, txtNuevaDireccion) || ValidacionesPropietario.validaTelefono(nuevoTelefono, txtNuevoTelefono)) {
                valida = false;
                JOptionPane.showMessageDialog(jPanel12, "Por favor verifique los datos ingresados", "Error", JOptionPane.ERROR_MESSAGE);

            } else {
                modificarPropietarios();
                dlgModificarPropietarios.setVisible(false);
            }
            valida = false;
        }

    }//GEN-LAST:event_btnAceptarPropietarioActionPerformed
//______________________________________________________________________________

    private void cbxFiltroItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cbxFiltroItemStateChanged

        int Valor = cbxFiltro.getSelectedIndex();

        if (Valor == 0) {
            txtBuscar.setText("");
            llenarPropietarios("");
        } else if (Valor == 1) {
            txtBuscar.setText("");
            llenarPropietarios("");
        }

    }//GEN-LAST:event_cbxFiltroItemStateChanged
//______________________________________________________________________________
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAceptarMarca;
    private javax.swing.JButton btnAceptarPropietario;
    private javax.swing.JButton btnAceptarRuta;
    private javax.swing.JButton btnAceptarTipo;
    private javax.swing.JButton btnEliminarMarcas;
    private javax.swing.JButton btnEliminarPropietarios;
    private javax.swing.JButton btnEliminarRuta;
    private javax.swing.JButton btnEliminarTipo;
    private javax.swing.JButton btnIngresarMarca;
    private javax.swing.JButton btnIngresarPropietario;
    private javax.swing.JButton btnIngresarRuta;
    private javax.swing.JButton btnIngresarTipo;
    private javax.swing.JButton btnModificarMarcas;
    private javax.swing.JButton btnModificarPropietarios;
    private javax.swing.JButton btnModificarRuta;
    private javax.swing.JButton btnModificarTipos;
    private javax.swing.JButton btnVerTablaMarcas;
    private javax.swing.JButton btnVerTablaPropietarios;
    private javax.swing.JButton btnVerTablaRutas;
    private javax.swing.JButton btnVerTablaTipos;
    private javax.swing.JComboBox cbxFiltro;
    private javax.swing.JDialog dlgCargandoDatos;
    private javax.swing.JDialog dlgMarcas;
    private javax.swing.JDialog dlgModificarMarcas;
    private javax.swing.JDialog dlgModificarPropietarios;
    private javax.swing.JDialog dlgModificarRutas;
    private javax.swing.JDialog dlgModificarTipos;
    private javax.swing.JDialog dlgPropietarios;
    private javax.swing.JDialog dlgRutas;
    private javax.swing.JDialog dlgTipos;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JLabel lblIdMarca;
    private javax.swing.JLabel lblIdPropietario;
    private javax.swing.JLabel lblIdRuta;
    private javax.swing.JLabel lblIdTipo;
    private javax.swing.JProgressBar pbCargarDatos;
    private javax.swing.JTable tablaMarcas;
    private javax.swing.JTable tablaPropietarios;
    private javax.swing.JTable tablaRutas;
    private javax.swing.JTable tablaTipos;
    private javax.swing.JTextField txtApellido;
    private javax.swing.JTextField txtBuscar;
    private javax.swing.JTextField txtCedula;
    private javax.swing.JTextField txtDireccion;
    private javax.swing.JTextField txtMarca;
    private javax.swing.JTextField txtNombre;
    private javax.swing.JTextField txtNuevaCedula;
    private javax.swing.JTextField txtNuevaDireccion;
    private javax.swing.JTextField txtNuevaMarca;
    private javax.swing.JTextField txtNuevaRuta;
    private javax.swing.JTextField txtNuevoTelefono;
    private javax.swing.JTextField txtNuevoTipo;
    private javax.swing.JTextField txtNuevosApellido;
    private javax.swing.JTextField txtNuevosNombre;
    private javax.swing.JTextField txtRuta;
    private javax.swing.JTextField txtTelefono;
    private javax.swing.JTextField txtTipo;
    // End of variables declaration//GEN-END:variables
}
